<script setup lang="ts">
import SlotDynamic from "@/components/SlotDynamic.vue";
import {ref} from "vue";

const options = ref([
  {
    value: 'a',
    label: '插槽A'
  },
  {
    value: 'b',
    label: '插槽B'
  },
  {
    value: 'c',
    label: '插槽C'
  }
])

const value = ref('')
const handleSelect =(value)=>{
     console.log(value);
}
</script>

<template>
<div>
  <el-select
    v-model="value"
    placeholder="Select"
    size="large"
    style="width: 240px"
    @change = handleSelect
  >
    <el-option
      v-for="item in options"
      :key="item.value"
      :label="item.label"
      :value="item.value"
    />
  </el-select>
  <SlotDynamic>
    <template #[value]>
        <h2>动态插槽</h2>
    </template>
  </SlotDynamic>
</div>
</template>

<style scoped>

</style>